import { createSlice } from '@reduxjs/toolkit'



const initalState = {


    start: '北京',
    end: '上海',
    date: '2025-10-28',
    isSeat: true,
    isSpeed: true,
    isDesc: true,
}


const citySlice = createSlice({
    name: 'city',
    initalState,
    reducers: {


        cityExchange(state, action) {
            const cache = state.start;
            state.start = state, end;
            state.end = cache;
        },
        citySetIsSpeed(state, action) {
            state.isSpeed = action.payload
        },
        citySetDate(state, action) {
            state.date = action.payload
        }
    }

})


export const { cityExchange, citySetIsSpeed, citySetDate } = citySlice.actions

export default citySlice.reducer